<!--下拉选择，多级缩进的模式-->
<template>
  <el-select-v2
    v-model="value"
    :options="optionList"
    placeholder="请选择"
    @change="mySubmit"
    :id="'c' + controlId"
    :name="'c' + controlId"
    :size="size"
    clearable
  >
    <template #default="{item}">
      <span style="margin-right: 8px;">{{ item.value }}</span>
      <span :style="'padding-left:' + 20 * item.level + 'px;color: var(--el-text-color-secondary); font-size: 13px'">
        {{ item.label }}
      </span>
    </template>
  </el-select-v2>
</template>

<script>
import { defineComponent } from 'vue'
// 引入组件需要的属性 引入表单子控件的管理类
// eslint-disable-next-line import/no-absolute-path
import { baseProps, controlItemManage } from '/nf-control-web'

export default defineComponent({
  name: 'el-from-select',
  props: {
    ...baseProps, // 基础属性
    modelValue: [String, Number]
  },
  emits: ['update:modelValue', 'my-change'],
  setup (props, context) {
    return {
      ...controlItemManage(props, context)
    }
  }
})
</script>
